<?php

namespace adminApi\modules\other\controllers;

use common\components\fast_api\Controller;

class FileController extends Controller
{
    /**
     * 上传base64文件
     * @desc 标准base64格式
     * @param string $base64
     * @return array
     * @throws \yii\base\Exception
     * @return array file
     */
    public function actionUploadByBase64($base64)
    {
        $file = \Yii::$app->fs->uploadByBase64($base64);
        $f = $file->toArray();
        $f['abUrl'] = $file->abUrl;
        return $this->apiSuccess(['file' => $f]);
    }
}
